import axios from './axios'

//获取设备列表（分页）
export function getEnergyDeviceList(params) {
    const url = '/ms/api/energyDevice/list'
    return axios.get(url, params)
}

//添加水电表
export function addDevice(params) {
    const url = '/ms/api/energyDevice/add'
    return axios.post(url, params)
}

//编辑水电表
export function editDevice(params) {
    const url = '/ms/api/energyDevice/edit'
    return axios.post(url, params)
}

//删除水电表
export function delDevice(params) {
    const url = '/ms/api/energyDevice/del/'
    return axios.post(url + params)
}

//水表详情
export function getWaterDetail(params) {
    const url = '/ms/api/energyWaterData/detailByTime'
    return axios.get(url, params)
}

//电表详情
export function getAmmeterDetail(params) {
    const url = '/ms/api/energyElectricityData/detailByTime'
    return axios.get(url, params)
}

// 电表报警类型
export function getAmmeterWarnRule(params) {
    const url = '/ms/api/energyElectricityData/getEnergyElectricityWarnRule'
    return axios.get(url, params)
}

// 报警未绑定设备
export function getEleList(params) {
    const url = '/ms/api/env/warn/getEleList'
    return axios.get(url, params)
}


/* ----------------------------------------------- */
//添加水表
export function Addwater(params) {
    const url = '/ms/api/energy/water/add'
    return axios.post(url, params)
}
//编辑设备
export function editwater(params) {
    const url = '/ms/api/energy/water/edit'
    return axios.post(url, params)
}
// 删除水设备
export function delWaterMach(params) {
    const url = '/ms/api/energy/water/del/'
    return axios.post(url + params)
}
//获取设备列表（分页）
export function getwaterPageList(params,page) {
    const url = '/ms/api/energy/water/list?pageNum=' + page
    return axios.get(url, params)
}
//获取设备列表（不分页）
export function getwaterList(params) {
    const url = '/ms/api/energy/water/list'
    return axios.get(url,params)
}
//设备用水统计
export function getwaterdevice(params) {
    const url = '/ms/api/energy/water/deviceStatistical'
    return axios.get(url, params)
}
//用水日统计
export function getwaterdays(params) {
    const url = '/ms/api/energy/water/dayStatistical'
    return axios.get(url, params)
}
//用水小时统计
export function getwaterHours(params) {
    const url = '/ms/api/energy/water/deviceHoursStatistical'
    return axios.get(url, params)
}

//添加电表
export function Addelectricity(params) {
    const url = '/ms/api/energy/electricity/add'
    return axios.post(url, params)
}
//编辑电表
export function editelectricity(params) {
    const url = '/ms/api/energy/electricity/edit'
    return axios.post(url, params)
}
// 删除设备
export function delelecMach(params) {
    const url = '/ms/api/energy/electricity/del/'
    return axios.post(url + params)
}
//查询设备列表、
//获取设备列表（分页）
export function getelecPageList(params,page) {
    const url = '/ms/api/energy/electricity/list?pageNum=' + page
    return axios.get(url, params)
}
//不分页
export function getelectricityList(params) {
    const url = '/ms/api/energy/electricity/list'
    return axios.get(url, params)
}
//设备用电统计
export function getElecdevice(params) {
    const url = '/ms/api/energy/electricity/deviceStatistical'
    return axios.get(url, params)
}
//用电日统计
export function getElecdays(params) {
    const url = '/ms/api/energy/electricity/dayStatistical'
    return axios.get(url, params)
}
//用电小时统计
export function getElecHours(params) {
    const url = '/ms/api/energy/electricity/deviceHoursStatistical'
    return axios.get(url, params)
}


//查询硬件平台列表
export function getHdcPlatformList(params) {
    const url = '/ms/api/hdc/platform/list'
    return axios.get(url, params)
}
//电箱设备列表
export function getEnergyElectricBoxList(params) {
    const url = '/ms/api/energy/electric/box/list'
    return axios.get(url, params)
}
//添加电箱设备
export function getEnergyElectricBoxAdd(params) {
    const url = '/ms/api/energy/electric/box/add'
    return axios.post(url, params)
}
//编辑电箱设备
export function getEnergyElectricBoxEdit(params) {
    const url = '/ms/api/energy/electric/box/edit'
    return axios.post(url, params)
}
//删除电箱设备
export function getEnergyElectricBoxDle(params) {
    const url = '/ms/api/energy/electric/box/del/'
    return axios.post(url+ params)
}

//查询电箱数据
export function getEnergyElectricBoxLog(params) {
    const url = '/ms/api/energy/electric/box/log'
    return axios.get(url, params)
}
